<template>
  <div>
    <el-row>
      <el-col :span="3" v-for="item in tableData" :key="item.id">
        <el-link :href="rootUrls[item.rootUrl]+item.path" target="_blank">
          <el-image
            style="width: 100px; height: 100px"
            :src="rootUrls[item.rootUrl]+item.path">
          </el-image>
        </el-link>
        <span class="demonstration">{{ item.name }}</span>
      </el-col>
    </el-row>
  </div>
</template>
<script>


export default {

  data() {
    return {
      rootUrls: {},
      tableData: [
        {rootUrl: 'riskVariable', path: '/refresh/riskDataFieldConf', name: '变量定义,刷新所有机器的本地JVM缓存'},
        {rootUrl: 'riskVariable', path: '/refresh/riskDataDict?version=1', name: '变量关联,刷新redis'},
        {rootUrl: 'riskVariable', path: '/refresh/refreshGroup?version=1', name: '变量分组,刷新redis'},
        {
          rootUrl: 'riskVariable',
          path: '/refresh/riskProductCodeMappingConfig',
          name: '刷新所有机器的映射配置(数据存本地jvm)'
        },
        {
          rootUrl: 'riskThird',
          path: '/refresh/variableInterfaceConfigAndDsPartner',
          name: '刷新所有机器的三方接口配置(数据存本地jvm)'
        }
      ]
    }
  },

  mounted() {
    this.pageList()
  },
  methods: {
    queryPage() {
      var _this = this
      _this.pageList()
    },
    pageList() {
      var _this = this
      this.$api.refreshList(_this.queryParam).then(res => {
        if (res.code === '00000') {
          _this.rootUrls = res.data
        } else {
          _this.$message(res.msg)
        }
      }).catch(e => {
        console.log('接口访问异常!')
      })
    }
  }
}
</script>
